//
//  ReciveBlockViewController.swift
//  SwiftDemo
//
//  Created by Jason on 15/10/30.
//  Copyright © 2015年 Jason Jiang. All rights reserved.
//

import UIKit

class ReciveBlockViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the viewvar       
        self.navigationItem.title = "Recive Block VC"
        self.view.backgroundColor = UIColor.grayColor();
        let btn:UIButton = UIButton (type: UIButtonType.Custom);
        btn.frame = CGRectMake(0, 64, 100, 80);
        btn.setTitle("blockBtn", forState: UIControlState.Normal);
        btn.addTarget(self, action: Selector("toBlockVC"), forControlEvents: UIControlEvents.TouchUpInside);
        self.view.addSubview(btn);
    }
    
    
    func toBlockVC(){
        
        let vc :BlockViewController = BlockViewController();
        
        vc.block2 = {(str:String) in
            
            
            NSLog("I have recive the block message");
            
            return str;
            
        }
        
        self.navigationController?.pushViewController(vc, animated: true);
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
